<template>
	<view class="content">
		<input type="text" value="" v-model="name" />
		<button type="default" @click="list()">查找</button>
		<table>
			<tr>
				<td>视频id</td>
				<td>视频简介</td>
				<td>封面图片</td>
				<td>标题</td>
				<td>用户</td>
			</tr>
			<tr v-for="v in data">
				<td>{{v.Id}}</td>
				<td>{{v.Des}}</td>
				<td><image :src="v.Image" mode="" style="width: 90px;height: 90px;"></image></td>
				<td>{{v.Title}}</td>
				<td>{{v.User}}</td>
			</tr>
		</table>	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:"",
				data:[],
			}
		},
		onLoad() {
			this.list()
		},
		methods: {
			list(){
				uni.request({
				    url: 'http://127.0.0.1:8080/list', //仅为示例，并非真实接口地址。
				    data: {
				        name:this.name
				    },
				    header: {
				        'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
				    },
				    success: (res) => {
				        console.log(res.data);
						this.data=res.data.Data
				    }
				});
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
